#include"c14_T3_worker.h"	
#include<iostream>

using std::cout;
using std::cin;
using std::endl;

//Woker methods
Worker::Worker() :_workerFullName("no one"), _workerID(0L)
{
}

Worker::Worker(const std::string & workerFullName, long workerID) : _workerFullName(workerFullName),
_workerID(workerID)
{
}

Worker::~Worker(){}

void Worker::WorkerData() const
{
	cout << "Name: " << _workerFullName << endl;
	cout << "Employee ID: " << _workerID << endl;
}

void Worker::SetWorkerInfo()
{
	getline(cin, _workerFullName);
	cout << "Enter worker's ID: ";
	cin >> _workerID;
	while (cin.get() != '\n')
		continue;
}

//Waiter methods
Waiter::Waiter() :Worker(), _waiterPanache(0)
{
}

Waiter::Waiter(const std::string & workerFullName, long workerID, int waiterPanache)
:Worker(workerFullName, workerID), _waiterPanache(waiterPanache)
{
}

Waiter::Waiter(const Worker & worker, int waiterPanache)
:Worker(worker), _waiterPanache(waiterPanache)
{
}

void Waiter::Set()
{
	cout << "Enter waiter's name: ";
	Worker::SetWorkerInfo();
	SetWorkerInfo();
}

void Waiter::Show() const
{
	cout << "Category: waiter \n";
	Worker::WorkerData();
	WorkerData();
}

void Waiter::WorkerData() const
{
	cout << "Panache rating: " << _waiterPanache << endl;
}

void Waiter::SetWorkerInfo()
{
	cout << "Enter waiter's panache rating: ";
	cin >> _waiterPanache;
	while (cin.get() != '\n')
		continue;
}

//Singer methods
char * Singer::_pv[Singer::SingerVoiceTypes] = { "other", "alto", "contralto", 
"soprano", "bass", "baritone", "tenor" };

Singer::Singer() : Worker(), _singerVoice(other)
{
}

Singer::Singer(const std::string & workerFullName, long workerID, int singerVoice)
: Worker(workerFullName, workerID), _singerVoice(singerVoice)
{
}

Singer::Singer(const Worker & worker, int singerVoice)
:Worker(worker), _singerVoice(singerVoice)
{
}

void Singer::Set()
{
	cout << "Enter singer's name: ";
	Worker::SetWorkerInfo();
	SetWorkerInfo();
}

void Singer::Show() const
{
	cout << "Category: singer \n";
	Worker::WorkerData();
	WorkerData();
}

void Singer::WorkerData() const
{
	cout << "Vocal range: " << _pv[_singerVoice] << endl;
}

void Singer::SetWorkerInfo()
{
	cout << "Enter the number for singer's vocal range: \n";
	int i;
	for (i = 0; i < SingerVoiceTypes; i++)
	{
		cout << i << ": " << _pv[i] << "    ";
		if (i % 4 == 3)
			cout << endl;
	}
	if (i % 4 != 0)
		cout << endl;
	cin >> _singerVoice;
	while (cin.get() != '\n')
		continue;
}

//SingingWaiter methods
SingingWaiter::SingingWaiter(){}

SingingWaiter::SingingWaiter(const std::string & workerFullName, long workerID, 
	int waiterPanache, int singerVoice)
:Worker(workerFullName, workerID),
Waiter(workerFullName, workerID, waiterPanache),
Singer(workerFullName, workerID, singerVoice)
{
}

SingingWaiter::SingingWaiter(const Worker & worker, int waiterPanache, int singerVoice)
:Worker(worker), Waiter(worker, waiterPanache), Singer(worker,singerVoice)
{
}

SingingWaiter::SingingWaiter(const Waiter & waiter, int singerVoice)
: Worker(waiter), Waiter(waiter), Singer(waiter, singerVoice)
{
}

SingingWaiter::SingingWaiter(const Singer & singer, int waiterPanache)
: Worker(singer), Waiter(singer, waiterPanache), Singer(singer)
{
}

void SingingWaiter::WorkerData() const
{
	Singer::WorkerData();
	Waiter::WorkerData();
}

void SingingWaiter::SetWorkerInfo()
{
	Waiter::SetWorkerInfo();
	Singer::SetWorkerInfo();
}

void SingingWaiter::Set()
{
	cout << "Enter singing waiter's name: ";
	Worker::SetWorkerInfo();
	SetWorkerInfo();
}

void SingingWaiter::Show() const
{
	cout << "Category: singing waiter \n";
	Worker::WorkerData();
	WorkerData();
}













